<h2>Game played on <%= @game.date_played %></h2>
Between <b><%= @game.home_team.name %></b> and <b><%= @game.visiting_team.name %></b>
<br /><br />
<% if @game.team_halve_summary.any? %>
	<table>
		<tr>
			<td align="left">&nbsp;</td>
			<td colspan="3" align="right" bgcolor="lightgrey"><%= @home_team.name %></td>
			<td colspan="3" align="right" bgcolor="lightgrey"><%= @visiting_team.name %></td>
		</tr>
		<tr>
			<td align="left">&nbsp;</td>
			<td align="right">1ST</td>
			<td align="right">2ND</td>
			<td align="right">TOTAL</td>
			<td align="right">1ST</td>
			<td align="right">2ND</td>
			<td align="right">TOTAL</td>
		</tr>
		<tr>
			<td align="left">FIRST DOWNS</td>
			<td align="right"><%= @home_team_first_half.first_downs %></td>
			<td align="right"><%= @home_team_second_half.first_downs %></td>
			<td align="right"><%= @home_team_first_half.first_downs + @home_team_second_half.first_downs %></td>
			<td align="right"><%= @visting_team_first_half.first_downs %></td>
			<td align="right"><%= @visiting_team_second_half.first_downs %></td>
			<td align="right"><%= @visting_team_first_half.first_downs + @visiting_team_second_half.first_downs %></td>
		</tr>
		<tr>
			<td align="left">YARDS RUSHING</td>
			<td align="right"><%= @home_team_first_half.yards_rushing %></td>
			<td align="right"><%= @home_team_second_half.yards_rushing %></td>
			<td align="right"><%= @home_team_first_half.yards_rushing + @home_team_second_half.yards_rushing %></td>
			<td align="right"><%= @visting_team_first_half.yards_rushing %></td>
			<td align="right"><%= @visiting_team_second_half.yards_rushing %></td>
			<td align="right"><%= @visting_team_first_half.yards_rushing + @visiting_team_second_half.yards_rushing %></td>
		</tr>
		<tr>
			<td align="left">YARDS PASSING</td>
			<td align="right"><%= @home_team_first_half.yards_passing %></td>
			<td align="right"><%= @home_team_second_half.yards_passing %></td>
			<td align="right"><%= @home_team_first_half.yards_passing + @home_team_second_half.yards_passing %></td>
			<td align="right"><%= @visting_team_first_half.yards_passing %></td>
			<td align="right"><%= @visiting_team_second_half.yards_passing %></td>
			<td align="right"><%= @visting_team_first_half.yards_passing + @visiting_team_second_half.yards_passing %></td>
		</tr>
		<tr>
			<td align="left">TEAM LOSSES</td>
			<td align="right"><%= @home_team_first_half.losses %></td>
			<td align="right"><%= @home_team_second_half.losses %></td>
			<td align="right"><%= @home_team_first_half.losses + @home_team_second_half.losses %></td>
			<td align="right"><%= @visting_team_first_half.losses %></td>
			<td align="right"><%= @visiting_team_second_half.losses %></td>
			<td align="right"><%= @visting_team_first_half.losses + @visiting_team_second_half.losses %></td>
		</tr>
		<tr>
			<td align="left">NET OFFENSE</td>
			<td align="right"><%= @home_team_first_half.net_offense %></td>
			<td align="right"><%= @home_team_second_half.net_offense %></td>
			<td align="right"><%= @home_team_first_half.net_offense + @home_team_second_half.net_offense %></td>
			<td align="right"><%= @visting_team_first_half.net_offense %></td>
			<td align="right"><%= @visiting_team_second_half.net_offense %></td>
			<td align="right"><%= @visting_team_first_half.net_offense + @visiting_team_second_half.net_offense %></td>
		</tr>
		<tr>

			<td align="left">PASS. MADE/TRIED</td>
			<td align="right"><%= @home_team_first_half.pass_complete %>/<%= @home_team_first_half.pass_attempts %></td>
			<td align="right"><%= @home_team_second_half.pass_complete %>/<%= @home_team_second_half.pass_attempts %></td>
			<td align="right"><%= @home_team_first_half.pass_complete + @home_team_second_half.pass_complete %>/<%= @home_team_first_half.pass_attempts + @home_team_second_half.pass_attempts %></td>
			<td align="right"><%= @visting_team_first_half.pass_complete %>/<%= @visting_team_first_half.pass_attempts %></td>
			<td align="right"><%= @visiting_team_second_half.pass_complete %>/<%= @visiting_team_second_half.pass_attempts %></td>
			<td align="right"><%= @visting_team_first_half.pass_complete + @visiting_team_second_half.pass_complete %>/<%= @visting_team_first_half.pass_attempts + @visiting_team_second_half.pass_attempts %></td>
		</tr>
		<tr>
			<td align="left">INTERCEPTIONS BY</td>
			<td align="right"><%= @home_team_first_half.interception_throwns %></td>
			<td align="right"><%= @home_team_second_half.interception_throwns %></td>
			<td align="right"><%= @home_team_first_half.interception_throwns + @home_team_second_half.interception_throwns %></td>
			<td align="right"><%= @visting_team_first_half.interception_throwns %></td>
			<td align="right"><%= @visiting_team_second_half.interception_throwns %></td>
			<td align="right"><%= @visting_team_first_half.interception_throwns + @visiting_team_second_half.interception_throwns %></td>
		</tr>
		<tr>
			<td align="left">FUMBLES/LOST</td>
			<td align="right"><%= @home_team_first_half.fumbles %>/<%= @home_team_first_half.fumbles_lost %></td>
			<td align="right"><%= @home_team_second_half.fumbles %>/<%= @home_team_second_half.fumbles_lost %></td>
			<td align="right"><%= @home_team_first_half.fumbles + @home_team_second_half.fumbles %>/<%= @home_team_first_half.fumbles_lost + @home_team_second_half.fumbles_lost %></td>
			<td align="right"><%= @visting_team_first_half.fumbles %>/<%= @visting_team_first_half.fumbles_lost %></td>
			<td align="right"><%= @visiting_team_second_half.fumbles %>/<%= @visiting_team_second_half.fumbles_lost %></td>
			<td align="right"><%= @visting_team_first_half.fumbles + @visiting_team_second_half.fumbles %>/<%= @visting_team_first_half.fumbles_lost + @visiting_team_second_half.fumbles_lost %></td>
		</tr>
		<tr>
			<td align="left">PENALTIES/YARDS</td>
			<td align="right"><%= @home_team_first_half.penalties %>/<%= @home_team_first_half.penalty_yards %></td>
			<td align="right"><%= @home_team_second_half.penalties %>/<%= @home_team_second_half.penalty_yards %></td>
			<td align="right"><%= @home_team_first_half.penalties + @home_team_second_half.penalties %>/<%= @home_team_first_half.penalty_yards + @home_team_second_half.penalty_yards %></td>
			<td align="right"><%= @visting_team_first_half.penalties %>/<%= @visting_team_first_half.penalty_yards %></td>
			<td align="right"><%= @visiting_team_second_half.penalties %>/<%= @visiting_team_second_half.penalty_yards %></td>
			<td align="right"><%= @visting_team_first_half.penalties + @visiting_team_second_half.penalties %>/<%= @visting_team_first_half.penalty_yards + @visiting_team_second_half.penalty_yards %></td>
		</tr>
	</table>
<% else %>
	<%= link_to 'Add results for the game (Summary)', new_game_team_halve_summary_path(@game) %>
<% end %>


